package com.s3.khospitalds.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.s3.khospitalds.entity.Storage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/2/28
 * @Description: 药库信息表
 * @Version: 1.0
 */
@Mapper
@Repository
public interface StorageMapper extends BaseMapper<Storage> {
    @Select("SELECT * FROM `storage` WHERE `name` LIKE concat('%',#{name},'%')")
    public List<Storage> findByName(String name);

    @Insert("INSERT INTO `storage` VALUES(NULL, #{name} , #{manufacturers} , #{amount} , #{handlers} , #{temperature} , #{qualityOfficer} , #{warehouseman} , #{pattern}, #{species} , #{productionData} , #{specification} ,#{dosageForm} ,#{date2} , #{unitPrice} )")
    public int insertStorage(Storage storage);
}
